//
//  LockOpenSetTableViewCell.m
//  IntelligentHousehold
//
//  Created by wmwMAC on 17/6/23.
//  Copyright © 2017年 Cassie. All rights reserved.
//

#import "LockOpenSetTableViewCell.h"

@implementation LockOpenSetTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    [self.openBtn setBackgroundImage:[UIImage imageNamed:@"kssz_dxk1"] forState:(UIControlStateSelected)];
    [self.openBtn setBackgroundImage:[UIImage imageNamed:@"kssz_dxk"] forState:(UIControlStateNormal)];
    self.openBtn.selected = NO;
}


- (IBAction)openBtnSelect:(UIButton *)sender {
    sender.selected = !sender.selected;
    
    if ([self.delegate respondsToSelector:@selector(lockOpenSetPassOn:index:)]) {
        
        [self.delegate lockOpenSetPassOn:sender.selected index:self.tag];
        
    }
    
}

- (void)setIsOn:(BOOL)isOn{
    _isOn = isOn;
    if (isOn == YES) {
        self.openBtn.selected = YES;
    } else {
        self.openBtn.selected = NO;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
